<?php
	/**
	 * This is a MetaControl class, providing a QForm or QPanel access to event handlers
	 * and QControls to perform the Create, Edit, and Delete functionality
	 * of the TableUserAddress class.  This code-generated class
	 * contains all the basic elements to help a QPanel or QForm display an HTML form that can
	 * manipulate a single TableUserAddress object.
	 *
	 * To take advantage of some (or all) of these control objects, you
	 * must create a new QForm or QPanel which instantiates a TableUserAddressMetaControl
	 * class.
	 *
	 * Any and all changes to this file will be overwritten with any subsequent
	 * code re-generation.
	 * 
	 * @package My Application
	 * @subpackage MetaControls
	 * property-read TableUserAddress $TableUserAddress the actual TableUserAddress data class being edited
	 * property QLabel $IdControl
	 * property-read QLabel $IdLabel
	 * property QListBox $UserIdControl
	 * property-read QLabel $UserIdLabel
	 * property QTextBox $FirstnameControl
	 * property-read QLabel $FirstnameLabel
	 * property QTextBox $LastnameControl
	 * property-read QLabel $LastnameLabel
	 * property QTextBox $CompanynameControl
	 * property-read QLabel $CompanynameLabel
	 * property QTextBox $CountryControl
	 * property-read QLabel $CountryLabel
	 * property QTextBox $CityControl
	 * property-read QLabel $CityLabel
	 * property QTextBox $PhoneControl
	 * property-read QLabel $PhoneLabel
	 * property QTextBox $FaxControl
	 * property-read QLabel $FaxLabel
	 * property QTextBox $Address1Control
	 * property-read QLabel $Address1Label
	 * property QTextBox $Address2Control
	 * property-read QLabel $Address2Label
	 * property QTextBox $PostalCodeControl
	 * property-read QLabel $PostalCodeLabel
	 * property QDateTimePicker $CreateDateControl
	 * property-read QLabel $CreateDateLabel
	 * property QIntegerTextBox $StatusControl
	 * property-read QLabel $StatusLabel
	 * property QTextBox $StateControl
	 * property-read QLabel $StateLabel
	 * property QTextBox $FirstnameKanaControl
	 * property-read QLabel $FirstnameKanaLabel
	 * property QTextBox $LastnameKanaControl
	 * property-read QLabel $LastnameKanaLabel
	 * property QDateTimePicker $UpdateDateControl
	 * property-read QLabel $UpdateDateLabel
	 * property-read string $TitleVerb a verb indicating whether or not this is being edited or created
	 * property-read boolean $EditMode a boolean indicating whether or not this is being edited or created
	 */

	class TableUserAddressMetaControlGen extends QBaseClass {
		// General Variables
		protected $objTableUserAddress;
		protected $objParentObject;
		protected $strTitleVerb;
		protected $blnEditMode;

		// Controls that allow the editing of TableUserAddress's individual data fields
		protected $lblId;
		protected $lstUser;
		protected $txtFirstname;
		protected $txtLastname;
		protected $txtCompanyname;
		protected $txtCountry;
		protected $txtCity;
		protected $txtPhone;
		protected $txtFax;
		protected $txtAddress1;
		protected $txtAddress2;
		protected $txtPostalCode;
		protected $calCreateDate;
		protected $txtStatus;
		protected $txtState;
		protected $txtFirstnameKana;
		protected $txtLastnameKana;
		protected $calUpdateDate;

		// Controls that allow the viewing of TableUserAddress's individual data fields
		protected $lblUserId;
		protected $lblFirstname;
		protected $lblLastname;
		protected $lblCompanyname;
		protected $lblCountry;
		protected $lblCity;
		protected $lblPhone;
		protected $lblFax;
		protected $lblAddress1;
		protected $lblAddress2;
		protected $lblPostalCode;
		protected $lblCreateDate;
		protected $lblStatus;
		protected $lblState;
		protected $lblFirstnameKana;
		protected $lblLastnameKana;
		protected $lblUpdateDate;

		// QListBox Controls (if applicable) to edit Unique ReverseReferences and ManyToMany References

		// QLabel Controls (if applicable) to view Unique ReverseReferences and ManyToMany References


		/**
		 * Main constructor.  Constructor OR static create methods are designed to be called in either
		 * a parent QPanel or the main QForm when wanting to create a
		 * TableUserAddressMetaControl to edit a single TableUserAddress object within the
		 * QPanel or QForm.
		 *
		 * This constructor takes in a single TableUserAddress object, while any of the static
		 * create methods below can be used to construct based off of individual PK ID(s).
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableUserAddressMetaControl
		 * @param TableUserAddress $objTableUserAddress new or existing TableUserAddress object
		 */
		 public function __construct($objParentObject, TableUserAddress $objTableUserAddress) {
			// Setup Parent Object (e.g. QForm or QPanel which will be using this TableUserAddressMetaControl)
			$this->objParentObject = $objParentObject;

			// Setup linked TableUserAddress object
			$this->objTableUserAddress = $objTableUserAddress;

			// Figure out if we're Editing or Creating New
			if ($this->objTableUserAddress->__Restored) {
				$this->strTitleVerb = QApplication::Translate('Edit');
				$this->blnEditMode = true;
			} else {
				$this->strTitleVerb = QApplication::Translate('Create');
				$this->blnEditMode = false;
			}
		 }

		/**
		 * Static Helper Method to Create using PK arguments
		 * You must pass in the PK arguments on an object to load, or leave it blank to create a new one.
		 * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo
		 * static helper methods.  Finally, specify a CreateType to define whether or not we are only allowed to 
		 * edit, or if we are also allowed to create a new one, etc.
		 * 
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableUserAddressMetaControl
		 * @param integer $intId primary key value
		 * @param QMetaControlCreateType $intCreateType rules governing TableUserAddress object creation - defaults to CreateOrEdit
 		 * @return TableUserAddressMetaControl
		 */
		public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			// Attempt to Load from PK Arguments
			if (strlen($intId)) {
				$objTableUserAddress = TableUserAddress::Load($intId);

				// TableUserAddress was found -- return it!
				if ($objTableUserAddress)
					return new TableUserAddressMetaControl($objParentObject, $objTableUserAddress);

				// If CreateOnRecordNotFound not specified, throw an exception
				else if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound)
					throw new QCallerException('Could not find a TableUserAddress object with PK arguments: ' . $intId);

			// If EditOnly is specified, throw an exception
			} else if ($intCreateType == QMetaControlCreateType::EditOnly)
				throw new QCallerException('No PK arguments specified');

			// If we are here, then we need to create a new record
			return new TableUserAddressMetaControl($objParentObject, new TableUserAddress());
		}

		/**
		 * Static Helper Method to Create using PathInfo arguments
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableUserAddressMetaControl
		 * @param QMetaControlCreateType $intCreateType rules governing TableUserAddress object creation - defaults to CreateOrEdit
		 * @return TableUserAddressMetaControl
		 */
		public static function CreateFromPathInfo($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			$intId = QApplication::PathInfo(0);
			return TableUserAddressMetaControl::Create($objParentObject, $intId, $intCreateType);
		}

		/**
		 * Static Helper Method to Create using QueryString arguments
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this TableUserAddressMetaControl
		 * @param QMetaControlCreateType $intCreateType rules governing TableUserAddress object creation - defaults to CreateOrEdit
		 * @return TableUserAddressMetaControl
		 */
		public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			$intId = QApplication::QueryString('intId');
			return TableUserAddressMetaControl::Create($objParentObject, $intId, $intCreateType);
		}



		///////////////////////////////////////////////
		// PUBLIC CREATE and REFRESH METHODS
		///////////////////////////////////////////////

		/**
		 * Create and setup QLabel lblId
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblId_Create($strControlId = null) {
			$this->lblId = new QLabel($this->objParentObject, $strControlId);
			$this->lblId->Name = QApplication::Translate('Id');
			if ($this->blnEditMode)
				$this->lblId->Text = $this->objTableUserAddress->Id;
			else
				$this->lblId->Text = 'N/A';
			return $this->lblId;
		}

		/**
		 * Create and setup QListBox lstUser
		 * @param string $strControlId optional ControlId to use
		 * @return QListBox
		 */
		public function lstUser_Create($strControlId = null) {
			$this->lstUser = new QListBox($this->objParentObject, $strControlId);
			$this->lstUser->Name = QApplication::Translate('User');
			$this->lstUser->Required = true;
			if (!$this->blnEditMode)
				$this->lstUser->AddItem(QApplication::Translate('- Select One -'), null);
			$objUserArray = TableUserProject::LoadAll();
			if ($objUserArray) foreach ($objUserArray as $objUser) {
				$objListItem = new QListItem($objUser->__toString(), $objUser->Id);
				if (($this->objTableUserAddress->User) && ($this->objTableUserAddress->User->Id == $objUser->Id))
					$objListItem->Selected = true;
				$this->lstUser->AddItem($objListItem);
			}
			return $this->lstUser;
		}

		/**
		 * Create and setup QLabel lblUserId
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblUserId_Create($strControlId = null) {
			$this->lblUserId = new QLabel($this->objParentObject, $strControlId);
			$this->lblUserId->Name = QApplication::Translate('User');
			$this->lblUserId->Text = ($this->objTableUserAddress->User) ? $this->objTableUserAddress->User->__toString() : null;
			$this->lblUserId->Required = true;
			return $this->lblUserId;
		}

		/**
		 * Create and setup QTextBox txtFirstname
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtFirstname_Create($strControlId = null) {
			$this->txtFirstname = new QTextBox($this->objParentObject, $strControlId);
			$this->txtFirstname->Name = QApplication::Translate('Firstname');
			$this->txtFirstname->Text = $this->objTableUserAddress->Firstname;
			$this->txtFirstname->MaxLength = TableUserAddress::FirstnameMaxLength;
			return $this->txtFirstname;
		}

		/**
		 * Create and setup QLabel lblFirstname
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblFirstname_Create($strControlId = null) {
			$this->lblFirstname = new QLabel($this->objParentObject, $strControlId);
			$this->lblFirstname->Name = QApplication::Translate('Firstname');
			$this->lblFirstname->Text = $this->objTableUserAddress->Firstname;
			return $this->lblFirstname;
		}

		/**
		 * Create and setup QTextBox txtLastname
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtLastname_Create($strControlId = null) {
			$this->txtLastname = new QTextBox($this->objParentObject, $strControlId);
			$this->txtLastname->Name = QApplication::Translate('Lastname');
			$this->txtLastname->Text = $this->objTableUserAddress->Lastname;
			$this->txtLastname->MaxLength = TableUserAddress::LastnameMaxLength;
			return $this->txtLastname;
		}

		/**
		 * Create and setup QLabel lblLastname
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblLastname_Create($strControlId = null) {
			$this->lblLastname = new QLabel($this->objParentObject, $strControlId);
			$this->lblLastname->Name = QApplication::Translate('Lastname');
			$this->lblLastname->Text = $this->objTableUserAddress->Lastname;
			return $this->lblLastname;
		}

		/**
		 * Create and setup QTextBox txtCompanyname
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtCompanyname_Create($strControlId = null) {
			$this->txtCompanyname = new QTextBox($this->objParentObject, $strControlId);
			$this->txtCompanyname->Name = QApplication::Translate('Companyname');
			$this->txtCompanyname->Text = $this->objTableUserAddress->Companyname;
			$this->txtCompanyname->MaxLength = TableUserAddress::CompanynameMaxLength;
			return $this->txtCompanyname;
		}

		/**
		 * Create and setup QLabel lblCompanyname
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblCompanyname_Create($strControlId = null) {
			$this->lblCompanyname = new QLabel($this->objParentObject, $strControlId);
			$this->lblCompanyname->Name = QApplication::Translate('Companyname');
			$this->lblCompanyname->Text = $this->objTableUserAddress->Companyname;
			return $this->lblCompanyname;
		}

		/**
		 * Create and setup QTextBox txtCountry
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtCountry_Create($strControlId = null) {
			$this->txtCountry = new QTextBox($this->objParentObject, $strControlId);
			$this->txtCountry->Name = QApplication::Translate('Country');
			$this->txtCountry->Text = $this->objTableUserAddress->Country;
			$this->txtCountry->MaxLength = TableUserAddress::CountryMaxLength;
			return $this->txtCountry;
		}

		/**
		 * Create and setup QLabel lblCountry
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblCountry_Create($strControlId = null) {
			$this->lblCountry = new QLabel($this->objParentObject, $strControlId);
			$this->lblCountry->Name = QApplication::Translate('Country');
			$this->lblCountry->Text = $this->objTableUserAddress->Country;
			return $this->lblCountry;
		}

		/**
		 * Create and setup QTextBox txtCity
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtCity_Create($strControlId = null) {
			$this->txtCity = new QTextBox($this->objParentObject, $strControlId);
			$this->txtCity->Name = QApplication::Translate('City');
			$this->txtCity->Text = $this->objTableUserAddress->City;
			$this->txtCity->MaxLength = TableUserAddress::CityMaxLength;
			return $this->txtCity;
		}

		/**
		 * Create and setup QLabel lblCity
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblCity_Create($strControlId = null) {
			$this->lblCity = new QLabel($this->objParentObject, $strControlId);
			$this->lblCity->Name = QApplication::Translate('City');
			$this->lblCity->Text = $this->objTableUserAddress->City;
			return $this->lblCity;
		}

		/**
		 * Create and setup QTextBox txtPhone
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtPhone_Create($strControlId = null) {
			$this->txtPhone = new QTextBox($this->objParentObject, $strControlId);
			$this->txtPhone->Name = QApplication::Translate('Phone');
			$this->txtPhone->Text = $this->objTableUserAddress->Phone;
			$this->txtPhone->MaxLength = TableUserAddress::PhoneMaxLength;
			return $this->txtPhone;
		}

		/**
		 * Create and setup QLabel lblPhone
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblPhone_Create($strControlId = null) {
			$this->lblPhone = new QLabel($this->objParentObject, $strControlId);
			$this->lblPhone->Name = QApplication::Translate('Phone');
			$this->lblPhone->Text = $this->objTableUserAddress->Phone;
			return $this->lblPhone;
		}

		/**
		 * Create and setup QTextBox txtFax
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtFax_Create($strControlId = null) {
			$this->txtFax = new QTextBox($this->objParentObject, $strControlId);
			$this->txtFax->Name = QApplication::Translate('Fax');
			$this->txtFax->Text = $this->objTableUserAddress->Fax;
			$this->txtFax->MaxLength = TableUserAddress::FaxMaxLength;
			return $this->txtFax;
		}

		/**
		 * Create and setup QLabel lblFax
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblFax_Create($strControlId = null) {
			$this->lblFax = new QLabel($this->objParentObject, $strControlId);
			$this->lblFax->Name = QApplication::Translate('Fax');
			$this->lblFax->Text = $this->objTableUserAddress->Fax;
			return $this->lblFax;
		}

		/**
		 * Create and setup QTextBox txtAddress1
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtAddress1_Create($strControlId = null) {
			$this->txtAddress1 = new QTextBox($this->objParentObject, $strControlId);
			$this->txtAddress1->Name = QApplication::Translate('Address 1');
			$this->txtAddress1->Text = $this->objTableUserAddress->Address1;
			$this->txtAddress1->Required = true;
			$this->txtAddress1->MaxLength = TableUserAddress::Address1MaxLength;
			return $this->txtAddress1;
		}

		/**
		 * Create and setup QLabel lblAddress1
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblAddress1_Create($strControlId = null) {
			$this->lblAddress1 = new QLabel($this->objParentObject, $strControlId);
			$this->lblAddress1->Name = QApplication::Translate('Address 1');
			$this->lblAddress1->Text = $this->objTableUserAddress->Address1;
			$this->lblAddress1->Required = true;
			return $this->lblAddress1;
		}

		/**
		 * Create and setup QTextBox txtAddress2
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtAddress2_Create($strControlId = null) {
			$this->txtAddress2 = new QTextBox($this->objParentObject, $strControlId);
			$this->txtAddress2->Name = QApplication::Translate('Address 2');
			$this->txtAddress2->Text = $this->objTableUserAddress->Address2;
			$this->txtAddress2->MaxLength = TableUserAddress::Address2MaxLength;
			return $this->txtAddress2;
		}

		/**
		 * Create and setup QLabel lblAddress2
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblAddress2_Create($strControlId = null) {
			$this->lblAddress2 = new QLabel($this->objParentObject, $strControlId);
			$this->lblAddress2->Name = QApplication::Translate('Address 2');
			$this->lblAddress2->Text = $this->objTableUserAddress->Address2;
			return $this->lblAddress2;
		}

		/**
		 * Create and setup QTextBox txtPostalCode
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtPostalCode_Create($strControlId = null) {
			$this->txtPostalCode = new QTextBox($this->objParentObject, $strControlId);
			$this->txtPostalCode->Name = QApplication::Translate('Postal Code');
			$this->txtPostalCode->Text = $this->objTableUserAddress->PostalCode;
			$this->txtPostalCode->MaxLength = TableUserAddress::PostalCodeMaxLength;
			return $this->txtPostalCode;
		}

		/**
		 * Create and setup QLabel lblPostalCode
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblPostalCode_Create($strControlId = null) {
			$this->lblPostalCode = new QLabel($this->objParentObject, $strControlId);
			$this->lblPostalCode->Name = QApplication::Translate('Postal Code');
			$this->lblPostalCode->Text = $this->objTableUserAddress->PostalCode;
			return $this->lblPostalCode;
		}

		/**
		 * Create and setup QDateTimePicker calCreateDate
		 * @param string $strControlId optional ControlId to use
		 * @return QDateTimePicker
		 */
		public function calCreateDate_Create($strControlId = null) {
			$this->calCreateDate = new QDateTimePicker($this->objParentObject, $strControlId);
			$this->calCreateDate->Name = QApplication::Translate('Create Date');
			$this->calCreateDate->DateTime = $this->objTableUserAddress->CreateDate;
			$this->calCreateDate->DateTimePickerType = QDateTimePickerType::DateTime;
			return $this->calCreateDate;
		}

		/**
		 * Create and setup QLabel lblCreateDate
		 * @param string $strControlId optional ControlId to use
		 * @param string $strDateTimeFormat optional DateTimeFormat to use
		 * @return QLabel
		 */
		public function lblCreateDate_Create($strControlId = null, $strDateTimeFormat = null) {
			$this->lblCreateDate = new QLabel($this->objParentObject, $strControlId);
			$this->lblCreateDate->Name = QApplication::Translate('Create Date');
			$this->strCreateDateDateTimeFormat = $strDateTimeFormat;
			$this->lblCreateDate->Text = sprintf($this->objTableUserAddress->CreateDate) ? $this->objTableUserAddress->CreateDate->__toString($this->strCreateDateDateTimeFormat) : null;
			return $this->lblCreateDate;
		}

		protected $strCreateDateDateTimeFormat;


		/**
		 * Create and setup QIntegerTextBox txtStatus
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtStatus_Create($strControlId = null) {
			$this->txtStatus = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtStatus->Name = QApplication::Translate('Status');
			$this->txtStatus->Text = $this->objTableUserAddress->Status;
			$this->txtStatus->Required = true;
			return $this->txtStatus;
		}

		/**
		 * Create and setup QLabel lblStatus
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblStatus_Create($strControlId = null, $strFormat = null) {
			$this->lblStatus = new QLabel($this->objParentObject, $strControlId);
			$this->lblStatus->Name = QApplication::Translate('Status');
			$this->lblStatus->Text = $this->objTableUserAddress->Status;
			$this->lblStatus->Required = true;
			$this->lblStatus->Format = $strFormat;
			return $this->lblStatus;
		}

		/**
		 * Create and setup QTextBox txtState
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtState_Create($strControlId = null) {
			$this->txtState = new QTextBox($this->objParentObject, $strControlId);
			$this->txtState->Name = QApplication::Translate('State');
			$this->txtState->Text = $this->objTableUserAddress->State;
			$this->txtState->Required = true;
			$this->txtState->MaxLength = TableUserAddress::StateMaxLength;
			return $this->txtState;
		}

		/**
		 * Create and setup QLabel lblState
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblState_Create($strControlId = null) {
			$this->lblState = new QLabel($this->objParentObject, $strControlId);
			$this->lblState->Name = QApplication::Translate('State');
			$this->lblState->Text = $this->objTableUserAddress->State;
			$this->lblState->Required = true;
			return $this->lblState;
		}

		/**
		 * Create and setup QTextBox txtFirstnameKana
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtFirstnameKana_Create($strControlId = null) {
			$this->txtFirstnameKana = new QTextBox($this->objParentObject, $strControlId);
			$this->txtFirstnameKana->Name = QApplication::Translate('Firstname Kana');
			$this->txtFirstnameKana->Text = $this->objTableUserAddress->FirstnameKana;
			$this->txtFirstnameKana->Required = true;
			$this->txtFirstnameKana->MaxLength = TableUserAddress::FirstnameKanaMaxLength;
			return $this->txtFirstnameKana;
		}

		/**
		 * Create and setup QLabel lblFirstnameKana
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblFirstnameKana_Create($strControlId = null) {
			$this->lblFirstnameKana = new QLabel($this->objParentObject, $strControlId);
			$this->lblFirstnameKana->Name = QApplication::Translate('Firstname Kana');
			$this->lblFirstnameKana->Text = $this->objTableUserAddress->FirstnameKana;
			$this->lblFirstnameKana->Required = true;
			return $this->lblFirstnameKana;
		}

		/**
		 * Create and setup QTextBox txtLastnameKana
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtLastnameKana_Create($strControlId = null) {
			$this->txtLastnameKana = new QTextBox($this->objParentObject, $strControlId);
			$this->txtLastnameKana->Name = QApplication::Translate('Lastname Kana');
			$this->txtLastnameKana->Text = $this->objTableUserAddress->LastnameKana;
			$this->txtLastnameKana->Required = true;
			$this->txtLastnameKana->MaxLength = TableUserAddress::LastnameKanaMaxLength;
			return $this->txtLastnameKana;
		}

		/**
		 * Create and setup QLabel lblLastnameKana
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblLastnameKana_Create($strControlId = null) {
			$this->lblLastnameKana = new QLabel($this->objParentObject, $strControlId);
			$this->lblLastnameKana->Name = QApplication::Translate('Lastname Kana');
			$this->lblLastnameKana->Text = $this->objTableUserAddress->LastnameKana;
			$this->lblLastnameKana->Required = true;
			return $this->lblLastnameKana;
		}

		/**
		 * Create and setup QDateTimePicker calUpdateDate
		 * @param string $strControlId optional ControlId to use
		 * @return QDateTimePicker
		 */
		public function calUpdateDate_Create($strControlId = null) {
			$this->calUpdateDate = new QDateTimePicker($this->objParentObject, $strControlId);
			$this->calUpdateDate->Name = QApplication::Translate('Update Date');
			$this->calUpdateDate->DateTime = $this->objTableUserAddress->UpdateDate;
			$this->calUpdateDate->DateTimePickerType = QDateTimePickerType::DateTime;
			$this->calUpdateDate->Required = true;
			return $this->calUpdateDate;
		}

		/**
		 * Create and setup QLabel lblUpdateDate
		 * @param string $strControlId optional ControlId to use
		 * @param string $strDateTimeFormat optional DateTimeFormat to use
		 * @return QLabel
		 */
		public function lblUpdateDate_Create($strControlId = null, $strDateTimeFormat = null) {
			$this->lblUpdateDate = new QLabel($this->objParentObject, $strControlId);
			$this->lblUpdateDate->Name = QApplication::Translate('Update Date');
			$this->strUpdateDateDateTimeFormat = $strDateTimeFormat;
			$this->lblUpdateDate->Text = sprintf($this->objTableUserAddress->UpdateDate) ? $this->objTableUserAddress->UpdateDate->__toString($this->strUpdateDateDateTimeFormat) : null;
			$this->lblUpdateDate->Required = true;
			return $this->lblUpdateDate;
		}

		protected $strUpdateDateDateTimeFormat;




		/**
		 * Refresh this MetaControl with Data from the local TableUserAddress object.
		 * @param boolean $blnReload reload TableUserAddress from the database
		 * @return void
		 */
		public function Refresh($blnReload = false) {
			if ($blnReload)
				$this->objTableUserAddress->Reload();

			if ($this->lblId) if ($this->blnEditMode) $this->lblId->Text = $this->objTableUserAddress->Id;

			if ($this->lstUser) {
					$this->lstUser->RemoveAllItems();
				if (!$this->blnEditMode)
					$this->lstUser->AddItem(QApplication::Translate('- Select One -'), null);
				$objUserArray = TableUserProject::LoadAll();
				if ($objUserArray) foreach ($objUserArray as $objUser) {
					$objListItem = new QListItem($objUser->__toString(), $objUser->Id);
					if (($this->objTableUserAddress->User) && ($this->objTableUserAddress->User->Id == $objUser->Id))
						$objListItem->Selected = true;
					$this->lstUser->AddItem($objListItem);
				}
			}
			if ($this->lblUserId) $this->lblUserId->Text = ($this->objTableUserAddress->User) ? $this->objTableUserAddress->User->__toString() : null;

			if ($this->txtFirstname) $this->txtFirstname->Text = $this->objTableUserAddress->Firstname;
			if ($this->lblFirstname) $this->lblFirstname->Text = $this->objTableUserAddress->Firstname;

			if ($this->txtLastname) $this->txtLastname->Text = $this->objTableUserAddress->Lastname;
			if ($this->lblLastname) $this->lblLastname->Text = $this->objTableUserAddress->Lastname;

			if ($this->txtCompanyname) $this->txtCompanyname->Text = $this->objTableUserAddress->Companyname;
			if ($this->lblCompanyname) $this->lblCompanyname->Text = $this->objTableUserAddress->Companyname;

			if ($this->txtCountry) $this->txtCountry->Text = $this->objTableUserAddress->Country;
			if ($this->lblCountry) $this->lblCountry->Text = $this->objTableUserAddress->Country;

			if ($this->txtCity) $this->txtCity->Text = $this->objTableUserAddress->City;
			if ($this->lblCity) $this->lblCity->Text = $this->objTableUserAddress->City;

			if ($this->txtPhone) $this->txtPhone->Text = $this->objTableUserAddress->Phone;
			if ($this->lblPhone) $this->lblPhone->Text = $this->objTableUserAddress->Phone;

			if ($this->txtFax) $this->txtFax->Text = $this->objTableUserAddress->Fax;
			if ($this->lblFax) $this->lblFax->Text = $this->objTableUserAddress->Fax;

			if ($this->txtAddress1) $this->txtAddress1->Text = $this->objTableUserAddress->Address1;
			if ($this->lblAddress1) $this->lblAddress1->Text = $this->objTableUserAddress->Address1;

			if ($this->txtAddress2) $this->txtAddress2->Text = $this->objTableUserAddress->Address2;
			if ($this->lblAddress2) $this->lblAddress2->Text = $this->objTableUserAddress->Address2;

			if ($this->txtPostalCode) $this->txtPostalCode->Text = $this->objTableUserAddress->PostalCode;
			if ($this->lblPostalCode) $this->lblPostalCode->Text = $this->objTableUserAddress->PostalCode;

			if ($this->calCreateDate) $this->calCreateDate->DateTime = $this->objTableUserAddress->CreateDate;
			if ($this->lblCreateDate) $this->lblCreateDate->Text = sprintf($this->objTableUserAddress->CreateDate) ? $this->objTableUserAddress->CreateDate->__toString($this->strCreateDateDateTimeFormat) : null;

			if ($this->txtStatus) $this->txtStatus->Text = $this->objTableUserAddress->Status;
			if ($this->lblStatus) $this->lblStatus->Text = $this->objTableUserAddress->Status;

			if ($this->txtState) $this->txtState->Text = $this->objTableUserAddress->State;
			if ($this->lblState) $this->lblState->Text = $this->objTableUserAddress->State;

			if ($this->txtFirstnameKana) $this->txtFirstnameKana->Text = $this->objTableUserAddress->FirstnameKana;
			if ($this->lblFirstnameKana) $this->lblFirstnameKana->Text = $this->objTableUserAddress->FirstnameKana;

			if ($this->txtLastnameKana) $this->txtLastnameKana->Text = $this->objTableUserAddress->LastnameKana;
			if ($this->lblLastnameKana) $this->lblLastnameKana->Text = $this->objTableUserAddress->LastnameKana;

			if ($this->calUpdateDate) $this->calUpdateDate->DateTime = $this->objTableUserAddress->UpdateDate;
			if ($this->lblUpdateDate) $this->lblUpdateDate->Text = sprintf($this->objTableUserAddress->UpdateDate) ? $this->objTableUserAddress->UpdateDate->__toString($this->strUpdateDateDateTimeFormat) : null;

		}



		///////////////////////////////////////////////
		// PROTECTED UPDATE METHODS for ManyToManyReferences (if any)
		///////////////////////////////////////////////





		///////////////////////////////////////////////
		// PUBLIC TABLEUSERADDRESS OBJECT MANIPULATORS
		///////////////////////////////////////////////

		/**
		 * This will save this object's TableUserAddress instance,
		 * updating only the fields which have had a control created for it.
		 */
		public function SaveTableUserAddress() {
			try {
				// Update any fields for controls that have been created
				if ($this->lstUser) $this->objTableUserAddress->UserId = $this->lstUser->SelectedValue;
				if ($this->txtFirstname) $this->objTableUserAddress->Firstname = $this->txtFirstname->Text;
				if ($this->txtLastname) $this->objTableUserAddress->Lastname = $this->txtLastname->Text;
				if ($this->txtCompanyname) $this->objTableUserAddress->Companyname = $this->txtCompanyname->Text;
				if ($this->txtCountry) $this->objTableUserAddress->Country = $this->txtCountry->Text;
				if ($this->txtCity) $this->objTableUserAddress->City = $this->txtCity->Text;
				if ($this->txtPhone) $this->objTableUserAddress->Phone = $this->txtPhone->Text;
				if ($this->txtFax) $this->objTableUserAddress->Fax = $this->txtFax->Text;
				if ($this->txtAddress1) $this->objTableUserAddress->Address1 = $this->txtAddress1->Text;
				if ($this->txtAddress2) $this->objTableUserAddress->Address2 = $this->txtAddress2->Text;
				if ($this->txtPostalCode) $this->objTableUserAddress->PostalCode = $this->txtPostalCode->Text;
				if ($this->calCreateDate) $this->objTableUserAddress->CreateDate = $this->calCreateDate->DateTime;
				if ($this->txtStatus) $this->objTableUserAddress->Status = $this->txtStatus->Text;
				if ($this->txtState) $this->objTableUserAddress->State = $this->txtState->Text;
				if ($this->txtFirstnameKana) $this->objTableUserAddress->FirstnameKana = $this->txtFirstnameKana->Text;
				if ($this->txtLastnameKana) $this->objTableUserAddress->LastnameKana = $this->txtLastnameKana->Text;
				if ($this->calUpdateDate) $this->objTableUserAddress->UpdateDate = $this->calUpdateDate->DateTime;

				// Update any UniqueReverseReferences (if any) for controls that have been created for it

				// Save the TableUserAddress object
				$this->objTableUserAddress->Save();

				// Finally, update any ManyToManyReferences (if any)
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * This will DELETE this object's TableUserAddress instance from the database.
		 * It will also unassociate itself from any ManyToManyReferences.
		 */
		public function DeleteTableUserAddress() {
			$this->objTableUserAddress->Delete();
		}		



		///////////////////////////////////////////////
		// PUBLIC GETTERS and SETTERS
		///////////////////////////////////////////////

		/**
		 * Override method to perform a property "Get"
		 * This will get the value of $strName
		 *
		 * @param string $strName Name of the property to get
		 * @return mixed
		 */
		public function __get($strName) {
			switch ($strName) {
				// General MetaControlVariables
				case 'TableUserAddress': return $this->objTableUserAddress;
				case 'TitleVerb': return $this->strTitleVerb;
				case 'EditMode': return $this->blnEditMode;

				// Controls that point to TableUserAddress fields -- will be created dynamically if not yet created
				case 'IdControl':
					if (!$this->lblId) return $this->lblId_Create();
					return $this->lblId;
				case 'IdLabel':
					if (!$this->lblId) return $this->lblId_Create();
					return $this->lblId;
				case 'UserIdControl':
					if (!$this->lstUser) return $this->lstUser_Create();
					return $this->lstUser;
				case 'UserIdLabel':
					if (!$this->lblUserId) return $this->lblUserId_Create();
					return $this->lblUserId;
				case 'FirstnameControl':
					if (!$this->txtFirstname) return $this->txtFirstname_Create();
					return $this->txtFirstname;
				case 'FirstnameLabel':
					if (!$this->lblFirstname) return $this->lblFirstname_Create();
					return $this->lblFirstname;
				case 'LastnameControl':
					if (!$this->txtLastname) return $this->txtLastname_Create();
					return $this->txtLastname;
				case 'LastnameLabel':
					if (!$this->lblLastname) return $this->lblLastname_Create();
					return $this->lblLastname;
				case 'CompanynameControl':
					if (!$this->txtCompanyname) return $this->txtCompanyname_Create();
					return $this->txtCompanyname;
				case 'CompanynameLabel':
					if (!$this->lblCompanyname) return $this->lblCompanyname_Create();
					return $this->lblCompanyname;
				case 'CountryControl':
					if (!$this->txtCountry) return $this->txtCountry_Create();
					return $this->txtCountry;
				case 'CountryLabel':
					if (!$this->lblCountry) return $this->lblCountry_Create();
					return $this->lblCountry;
				case 'CityControl':
					if (!$this->txtCity) return $this->txtCity_Create();
					return $this->txtCity;
				case 'CityLabel':
					if (!$this->lblCity) return $this->lblCity_Create();
					return $this->lblCity;
				case 'PhoneControl':
					if (!$this->txtPhone) return $this->txtPhone_Create();
					return $this->txtPhone;
				case 'PhoneLabel':
					if (!$this->lblPhone) return $this->lblPhone_Create();
					return $this->lblPhone;
				case 'FaxControl':
					if (!$this->txtFax) return $this->txtFax_Create();
					return $this->txtFax;
				case 'FaxLabel':
					if (!$this->lblFax) return $this->lblFax_Create();
					return $this->lblFax;
				case 'Address1Control':
					if (!$this->txtAddress1) return $this->txtAddress1_Create();
					return $this->txtAddress1;
				case 'Address1Label':
					if (!$this->lblAddress1) return $this->lblAddress1_Create();
					return $this->lblAddress1;
				case 'Address2Control':
					if (!$this->txtAddress2) return $this->txtAddress2_Create();
					return $this->txtAddress2;
				case 'Address2Label':
					if (!$this->lblAddress2) return $this->lblAddress2_Create();
					return $this->lblAddress2;
				case 'PostalCodeControl':
					if (!$this->txtPostalCode) return $this->txtPostalCode_Create();
					return $this->txtPostalCode;
				case 'PostalCodeLabel':
					if (!$this->lblPostalCode) return $this->lblPostalCode_Create();
					return $this->lblPostalCode;
				case 'CreateDateControl':
					if (!$this->calCreateDate) return $this->calCreateDate_Create();
					return $this->calCreateDate;
				case 'CreateDateLabel':
					if (!$this->lblCreateDate) return $this->lblCreateDate_Create();
					return $this->lblCreateDate;
				case 'StatusControl':
					if (!$this->txtStatus) return $this->txtStatus_Create();
					return $this->txtStatus;
				case 'StatusLabel':
					if (!$this->lblStatus) return $this->lblStatus_Create();
					return $this->lblStatus;
				case 'StateControl':
					if (!$this->txtState) return $this->txtState_Create();
					return $this->txtState;
				case 'StateLabel':
					if (!$this->lblState) return $this->lblState_Create();
					return $this->lblState;
				case 'FirstnameKanaControl':
					if (!$this->txtFirstnameKana) return $this->txtFirstnameKana_Create();
					return $this->txtFirstnameKana;
				case 'FirstnameKanaLabel':
					if (!$this->lblFirstnameKana) return $this->lblFirstnameKana_Create();
					return $this->lblFirstnameKana;
				case 'LastnameKanaControl':
					if (!$this->txtLastnameKana) return $this->txtLastnameKana_Create();
					return $this->txtLastnameKana;
				case 'LastnameKanaLabel':
					if (!$this->lblLastnameKana) return $this->lblLastnameKana_Create();
					return $this->lblLastnameKana;
				case 'UpdateDateControl':
					if (!$this->calUpdateDate) return $this->calUpdateDate_Create();
					return $this->calUpdateDate;
				case 'UpdateDateLabel':
					if (!$this->lblUpdateDate) return $this->lblUpdateDate_Create();
					return $this->lblUpdateDate;
				default:
					try {
						return parent::__get($strName);
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}
			}
		}

		/**
		 * Override method to perform a property "Set"
		 * This will set the property $strName to be $mixValue
		 *
		 * @param string $strName Name of the property to set
		 * @param string $mixValue New value of the property
		 * @return mixed
		 */
		public function __set($strName, $mixValue) {
			try {
				switch ($strName) {
					// Controls that point to TableUserAddress fields
					case 'IdControl':
						return ($this->lblId = QType::Cast($mixValue, 'QControl'));
					case 'UserIdControl':
						return ($this->lstUser = QType::Cast($mixValue, 'QControl'));
					case 'FirstnameControl':
						return ($this->txtFirstname = QType::Cast($mixValue, 'QControl'));
					case 'LastnameControl':
						return ($this->txtLastname = QType::Cast($mixValue, 'QControl'));
					case 'CompanynameControl':
						return ($this->txtCompanyname = QType::Cast($mixValue, 'QControl'));
					case 'CountryControl':
						return ($this->txtCountry = QType::Cast($mixValue, 'QControl'));
					case 'CityControl':
						return ($this->txtCity = QType::Cast($mixValue, 'QControl'));
					case 'PhoneControl':
						return ($this->txtPhone = QType::Cast($mixValue, 'QControl'));
					case 'FaxControl':
						return ($this->txtFax = QType::Cast($mixValue, 'QControl'));
					case 'Address1Control':
						return ($this->txtAddress1 = QType::Cast($mixValue, 'QControl'));
					case 'Address2Control':
						return ($this->txtAddress2 = QType::Cast($mixValue, 'QControl'));
					case 'PostalCodeControl':
						return ($this->txtPostalCode = QType::Cast($mixValue, 'QControl'));
					case 'CreateDateControl':
						return ($this->calCreateDate = QType::Cast($mixValue, 'QControl'));
					case 'StatusControl':
						return ($this->txtStatus = QType::Cast($mixValue, 'QControl'));
					case 'StateControl':
						return ($this->txtState = QType::Cast($mixValue, 'QControl'));
					case 'FirstnameKanaControl':
						return ($this->txtFirstnameKana = QType::Cast($mixValue, 'QControl'));
					case 'LastnameKanaControl':
						return ($this->txtLastnameKana = QType::Cast($mixValue, 'QControl'));
					case 'UpdateDateControl':
						return ($this->calUpdateDate = QType::Cast($mixValue, 'QControl'));
					default:
						return parent::__set($strName, $mixValue);
				}
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}
	}
?>